The present invention relates to computer networks, and more particularly to the transmission of data packets in the networks.
Network protocols, such as those for Local Area Networks (LANs) or Wide Area Networks (WANs) are well known in the art. Conventionally, data packets are transmitted between network nodes using differently routes. They may arrive at the destination node out of order and must be reordered. One method of determining the proper order is to use time stamps. The packets are reordered based upon the times at which they were transmitted by the transmitting node. To accomplish this, the transmitting and the receiving nodes must function within the same notion of time. For this reason, the clocks at the transmitting and receiving nodes must be synchronized. Algorithms for synchronizing the clocks are well known in the art.
An important parameter in synchronizing the clocks is the delay, i.e., the time required for a packet to travel from the transmitting node to the receiving node. If the actual delay is known for two nodes, then the clocks at the nodes may be synchronized by comparing the actual delay with the measured delay. Thus, the precision in detecting the transmission and arrival of a packet is key in obtaining an accurate measured delay. In this specification, this detecting is referred to as xe2x80x9ctime stampingxe2x80x9d.
Conventional methods use software to perform the time stamping. However, software methods involve several unknown time delays between the time the packet actually arrives or is transmitted and the time the software detects its arrival or transmission. For example, delay may occur for the software to obtain information from a buffer or to arbitrate access to a bus. These delays are unpredictable, and thus the time stamping is too inaccurate for clock synchronization.
Accordingly, there exists a need for a method and apparatus for accurate packet time stamping. The present invention addresses such a need.
The present invention provides a method and apparatus for accurate packet time stamping in a network. The apparatus includes a time stamping logic, where the time stamping logic detects when a packet is transmitted or received; and a time source, where time information from the time source is latched when the time stamping logic detects the packet. In the preferred embodiment, the time stamping logic monitors packet traffic on a bus. When the time stamping logic detects a packet, a time stamping signal is generated which latches time information from the time source. The time information may then be used to measure the transmission delay for the packet for synchronizing the clocks at the transmitting and receiving nodes.